<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="author" content="lijun; 67086071; zwlijun@qq.com" />
<title>RIA Client API - BY 小网</title>
<link href="css/api.css" type="text/css" rel="stylesheet" />
</head>

<body>
  <ins>此文档描述Storage对象的方法</ins>
  <div class="nav">
    <a href="#Storage">Storage()</a>
    <a href="#setData">setData()</a>
    <a href="#getData">getData()</a>
    <a href="#removeData">removeData()</a>
  </div>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">Storage方法<a name="Storage"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>构造方法 <br /> 参数file为可选值，用于IE环境下。</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>var storage = new Storage(file)</td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>构造方法</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var storage = new Storage();
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">setData方法<a name="setData"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>设置数据</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>
<pre>
storage.setData(key, value, iExpires)
key       键
value     值
iExpires  在IE下的过期时间，以小时为单位
</pre>
        </td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>设置数据</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
storage.setData("date", new Date().getTime(), 1);
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">getData方法<a name="getData"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>获取数据，找不到数据时返回null</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>
<pre>
var data = storage.getData(key)
key   键
</pre>
        </td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>获取数据，找不到数据时返回null</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
var date = storage.getData("date");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
  <table width="600" cellspacing="1" cellpadding="1" border="0">
    <tbody>
      <tr>
        <th colspan="2">removeData方法<a name="removeData"></a></th>
      </tr>
      <tr>
        <td class="label">作&nbsp;&nbsp;&nbsp;用</td>
        <td>删除数据</td>
      </tr>
      <tr>
        <td class="label">基本语法</td>
        <td>
<pre>
storage.removeData(key)
key   键
</pre>
        </td>
      </tr>
      <tr>
        <td class="label">说&nbsp;&nbsp;&nbsp;明</td>
        <td>删除数据</td>
      </tr>
      <tr>
        <td class="label">示&nbsp;&nbsp;&nbsp;例</td>
        <td>
<pre>
storage.removeData("date");
</pre>
        </td>
      </tr>
    </tbody>
  </table>
</body>
</html>